package com.solo.service.impl;

import com.solo.dao.CategoryDAO;
import com.solo.entity.Category;
import com.solo.service.CategoryService;

import java.util.List;

public class CategoryServiceImpl implements CategoryService {
    private CategoryDAO categoryDAO;

    public CategoryServiceImpl(){
        categoryDAO = new CategoryDAO();
    }

    @Override
    public boolean addCategory(Category category) {
        return categoryDAO.addCategory(category);
    }

    @Override
    public boolean deleteCategory(Category category) {
        return categoryDAO.deleteCategory(category);
    }

    @Override
    public boolean updateCategory(Category Category) {
        return categoryDAO.updateCategory(Category);
    }

    @Override
    public List<Category> selectAllCategory() {
        return categoryDAO.selectAllCategory();
    }

    @Override
    public Category selectCategoryById(Long id) {
        return categoryDAO.selectCategoryById(id);
    }
}
